package com.css.apps.base.org.action;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.css.apps.base.common.provider.json.OrgJsonProvider;
import com.css.apps.base.user.action.GetUserPostTree;
import com.css.core.configuration.Environment;
import com.css.util.Ajax;
import com.css.util.Messages;
import com.css.util.StringHelper;
import com.css.webbase.webwork.action.AdminAction;
import com.opensymphony.xwork.Action;

/**
 * <p>
 * 获得岗位功能
 * </p>
 * 
 */
@SuppressWarnings("serial")
public class GetOrgPostTree extends AdminAction {
	
	private static Log log = LogFactory.getLog(GetUserPostTree.class);
	private String orgId;

	@Override
	protected String adminGo() {
		try {
			if (StringHelper.isNotEmpty(orgId)) {
				OrgJsonProvider json = new OrgJsonProvider();
				result = json.getOrgPostTree(orgId).toString();
			}
			return SUCCESS;
		} catch (Exception ex) {
			result = Ajax.JSONResult(Environment.RESULT_CODE_ERROR, Messages.getString("systemMsg.exception"));
			log.error(ex.getMessage(), ex);
			return Action.ERROR;
		}
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

}
